<template>
    <div class="toast" @click.self="isShow = false" v-if="isShow">
      <div class="toast-div">{{ text }}</div>
    </div>
</template>

<script>
export default {
  name: "Toast",
  data() {
    return {
      text: "内容",
      isShow: true,
      duration: 1500,
    };
  },
};
</script>

<style scoped>
.toast {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.toast-div{
    width: 300px;
    height: 200px;
    color: white;
}
</style>
